#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    vector<int> subSort(vector<int>& array) {
        vector<int> ans = { -1, -1 };
        if (array.size() == 0)
            return ans;
        int l = 0;
        int ma = array[0];
        for (int i = 0; i < array.size(); i++)
        {
            if (array[i] < ma)
            {
                ans[1] = i;
            }
            else
            {
                ma = array[i];
            }
        }
        int mi = array[array.size() - 1];
        for (int i = array.size() - 1; i >= 0; i--)
        {
            if (array[i] > mi)
            {
                ans[0] = i;
            }
            else
            {
                mi = array[i];
            }
        }

        return ans;
    }
};